﻿<%@ Page Title="" Language="C#" MasterPageFile="~/User.Master" AutoEventWireup="true" CodeBehind="UserComment.aspx.cs" Inherits="ChineseSchool.Web.UserComment" ValidateRequest="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="server">
    <asp:Panel ID="divAdd" runat="server">
        <div class="row">
            <div class="col-md-12">
                <div class="box box-info">
                    <div class="box-header with-border">
                        <h3>Gửi đi thông điệp</h3>
                    </div>
                    <div class="form-horizontal">
                        <div class="box-body">
                            <div class="form-group">
                                <asp:Label ID="lblPostName" Text="Mô tả ngắn gọn:" CssClass="col-sm-3 control-label" runat="server" />
                                <div class="col-sm-9">
                                    <asp:TextBox runat="server" ID="txtPostName" CssClass="form-control" />
                                </div>
                            </div>
                            <div class="form-group">
                                <asp:Label ID="lblContent" Text="Nội dung cảm nhận:" CssClass="col-sm-3 control-label" runat="server" />
                                <div class="col-sm-9">
                                    <asp:TextBox runat="server" ID="txtPostContent" TextMode="MultiLine" Height="100" CssClass="form-control" />
                                </div>
                            </div>
                        </div>
                        <div class="box-footer">
                            <asp:Button ID="btnSave" runat="server" Text="Lưu lại" CssClass="btn btn-default" OnClick="btnSave_Click" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </asp:Panel>
    <asp:Panel ID="divContent" runat="server">
        <div class="row">
            <div class="col-xs-12">
                <div class="box">
                    <div class="box-header with-border">
                        <h3 class="box-title">Những bài viết liên quan:</h3>
                    </div>
                    <div class="box-body">
                        <asp:GridView ID="grdComment" runat="server" AutoGenerateColumns="False"
                            AllowPaging="True" EnableModelValidation="True" CssClass="table table-bordered"
                            AllowSorting="True" PageSize="10" ShowHeader="true" ShowHeaderWhenEmpty="true"
                            OnRowCommand="GrdLessonRowCommand" OnRowDeleting="GrdLessonRowDeleting"
                            OnRowEditing="GrdLessonRowEditing" OnPageIndexChanging="GrdLessonPageIndexChanging">
                            <PagerStyle BackColor="#F6F6F6" ForeColor="Black" HorizontalAlign="Center"
                                VerticalAlign="Middle" />
                            <Columns>
                                <asp:TemplateField ItemStyle-Width="50px" HeaderText="Stt">
                                    <ItemTemplate>
                                        <%# Container.DataItemIndex + 1 %>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <%--<asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:LinkButton Text='<%# Eval("PostName") %>' CommandArgument='<%# Eval("PostId") %>' CommandName="View" runat="server" />
                                    </ItemTemplate>
                                </asp:TemplateField>--%>
                                <asp:BoundField DataField="PostName" HtmlEncode="false" HeaderText="Tiêu đề" ReadOnly="true" />
                                <asp:BoundField DataField="PostContent" HtmlEncode="false" HeaderText="Nội dung" ReadOnly="true" />
                                <asp:BoundField DataField="PostDate" ItemStyle-Width="120px" HeaderText="Ngày đăng" DataFormatString="{0:dd/MM/yyyy}"
                                    HtmlEncode="false" ReadOnly="true" />
                            </Columns>
                        </asp:GridView>
                        <div class="text-left">
                            <b>
                                <asp:Label ID="lbl_count" runat="server" Visible="false"></asp:Label></b>
                        </div>
                    </div>

                    <div class="box-footer clearfix">
                        <div class="col-xs-6 text-left">
                            <i>Bạn đang xem trang
                            <%=grdComment.PageCount==0 &&  grdComment.PageIndex == 0 ? 0 : grdComment.PageIndex+1%>
                            của
                            <%=grdComment.PageCount%></i>
                        </div>
                        <div class="col-xs-6 text-right">
                            <asp:Button ID="btnAddnew" CssClass="btn btn-default" OnClick="BtnAddnewClick" Text="Thêm mới" runat="server" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </asp:Panel>
</asp:Content>
